package com.ansion.utils;


import com.ansion.preference.TurboBasePreference;

/**
 * 公共存储
 */
public class CommonPreferenceUtils extends TurboBasePreference {

    private static CommonPreferenceUtils mInstance;

    protected CommonPreferenceUtils(String name) {
        super(name);
    }

    public static CommonPreferenceUtils getInstance() {
        if (mInstance == null) {
            synchronized (CommonPreferenceUtils.class) {
                if (mInstance == null) {
                    mInstance = new CommonPreferenceUtils("botim_share_storage");
                }
            }
        }

        return mInstance;
    }

    /**
     * 只要是重新登录那么将认定用新的通知
     */
    public void setNewNotifycationDB() {
        putBoolean("new_notify_db", true);
    }

    /**
     * 老的通知系统是根据不同账号来创建不同的channel
     * 新版改为所有账号通用一套
     *
     * 用这个标识来判断.
     */
    public boolean useNewNotifycationDB() {
        return getBoolean("new_notify_db", false);
    }
}
